<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>


<form id="portal_form_<?php echo ($form->getObject()->isNew() ? 'new' : 'edit')?>"
      action="<?php echo url_for('portal/'.($form->getObject()->isNew() ? 'create' : 'update').
        (!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>"
        method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
    <input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="3">
            <?php if ($form->getObject()->isNew()):?>
            <a href="<?php echo url_for('portal') ?>">Cancelar</a>
            <input type="submit" value="Guardar" />
            <?php else: ?>
            <a class="edit_cancel"
               title="Cancelar"
               href="javascript:cancelarEditarPortal()"
               name="<?php echo url_for('portal_show',$form->getObject())?>"
            />
            <!--<a class="save"
               title="Guardar"
               href="javascript:actualizarPortal()"
            />-->
            <input class="save" type="image" value="" onclick="javascript:actualizarPortal()"/>
            <?php endif;?>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form ?>
    </tbody>
  </table>
</form>

<!-- Esta es la funcionalidad de eliminar un portal
<?php if (!$form->getObject()->isNew()): ?>
&nbsp;<?php echo link_to('Eliminar', 'portal/delete?id='.$form->getObject()->getId(),
    array('method' => 'delete',
        'confirm' => 'Está seguro de eliminar el portal '.$form->getObject()->getTitle())) ?>
<?php endif; ?>
-->